﻿import React from 'react';
import ReactDOM from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import { Provider } from 'react-redux';
import 'babel-polyfill';

import configureStore from './store/configureStore';

// AppContainer is a necessary wrapper component for HMR
import App from './components/App';
var initialState={
	nav:[
		{text:"A-Level_1",tag:"div",children:[
			{text:"A-Level_2-sssssss",tag:"div",children:[],attr:{value:111}},
			{text:"A-Level_2-ffffff",tag:"div",children:[]}
		]},
		{text:"B-Level_1",tag:"div",children:[
			{text:"B-Level_2-ggggggg",tag:"div",children:[]},
			{text:"B-Level_2-xxxxxxx",tag:"div",children:[]},
		]}
	],
	tableTest:{loading:false,data:{}}
};
const store = configureStore(initialState);

const render = (Component) => {
	ReactDOM.render(
		<AppContainer>
			<Provider store={store}>
			<Component/>
			</Provider>
			</AppContainer>,
		document.getElementById('root')
	);
};

render(App);

// Hot Module Replacement API
if (module.hot){
	module.hot.accept('./components/App', () => {
		render(App)
	});
}

